#!python
# 
# Python module build

# Import everything under the sun
import SCons
import SConsAddons.Options   # Get the modular options stuff
import SConsAddons.Util       # Get the utils
import sys, os, re, string
import glob
pj = os.path.join

Import('*')

# Get a list of all the .cpp files in the source directory
opensg_pymod_srcs = []
for path, dirs, files in SConsAddons.Util.WalkBuildFromSource('.',common_env):
   opensg_pymod_srcs += [pj(path,f) for f in files if f.endswith('.cpp')]

#print "Sources: ", opensg_pymod_srcs

# ----- Python bindings ------ #
osg_pymod_env = build_env.Copy();
boost_options.updatePythonModEnv(osg_pymod_env)
opensg_options.apply(osg_pymod_env, libs=['GLUT'], 
                         optimize=(combo["type"]=="optimized"))
osg_pymod_env.Append(CPPPATH = ['.'],
                     CPPDEFINES = ['BOOST_PYTHON_MAX_ARITY=16',])
 
# dso python library
osg_module = osg_pymod_env.SharedLibrary('osg', opensg_pymod_srcs)
osg_pymod_env.Install(inst_paths['python_lib'], osg_module[0])
